import json
#json在python中就是字典，但是字典的这个格式可以在所有的网络传递，所以json的字典会转换为字符串类型
s = '''
    {"name":"张三","age":22,"job":"外卖员"}
'''
#可以在python将其转换为dict对象
#将字符串转换为字典
t = json.loads(s)
print(t,type(t),t['name'])

with open('user.json','r',encoding='utf-8') as f:
    t1 = json.load(f)
    print(t1,type(t1))
    print(t1["books"])
